package test;


public class DivisionExample {
    public static void main(String[] args) {
        try {
            // 假设args是从外部输入的参数，这里仅用于示例
            int a = Integer.parseInt(args[0]);
            int b = Integer.parseInt(args[1]);
            int c = a / b;
            System.out.println("结果: " + c);
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("错误：输入的参数个数少于两个。");
        } catch (NumberFormatException e) {
            System.out.println("错误：输入了非整数。");
        } catch (ArithmeticException e) {
            System.out.println("错误：除数不能为0。");
        } catch (Exception e) {
            System.out.println("发生未知错误：" + e.getMessage());
        }
    }
}
